package com.example.administrator.about_huanxin.presenter.fragment;

import android.util.Log;

import com.example.administrator.about_huanxin.SimpelEmCallBack;
import com.example.administrator.about_huanxin.view.fragment.GerenFragmentView;
import com.hyphenate.chat.EMClient;

/**
 * Created by Administrator on 2017/3/23 0023.
 */

public class GerenPresenerImp implements GerenPresener {

    private GerenFragmentView gerenFragmentView;

    public GerenPresenerImp(GerenFragmentView gerenFragmentView) {
        this.gerenFragmentView = gerenFragmentView;
    }

    @Override
    public void logoutHx() {
        EMClient.getInstance().logout(true,new SimpelEmCallBack(){
            @Override
            public void onSuccess() {
                super.onSuccess();
                Log.e("logout","logout success");
                gerenFragmentView.logoutListener(true);
            }

            @Override
            public void onError(int i, String s) {
                super.onError(i, s);
                Log.e("logout",i+"..."+s);
                gerenFragmentView.logoutListener(false);
            }
        });
    }
}
